<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta id="viewport" name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" />
    <title>下载安装微淘氪</title>
    <link rel="stylesheet" type="text/css" href="css/index.css">
    <link rel="stylesheet" type="text/css" href="css/example.css">
    <link rel="stylesheet" type="text/css" href="css/sweet-alert.css">
    <style type="text/css">
        #bg {
            display: none;
            position: absolute;
            top: 0%;
            left: 0%;
            width: 100%;
            height: 100%;
            background-color: black;
            z-index: 1001;
            -moz-opacity: 0.7;
            opacity: .70;
            filter: alpha(opacity=70);
            overflow: hidden;
        }

        #show {
            display: none;
            position: absolute;
            top: 0%;
            left: 0%;
            width: 100%;
            height: 100%;
            background-color: white;
            z-index: 1002;
            overflow: auto;
            opacity: 0.8;
        }
    </style>
</head>

<body>
    <div id="show">
        <img src="images/wx.jpg" width="100%" height="100%" id="div_show">
    </div>
    <div class="main" id="main_a" style="display: block;">
        <img src="images/bg.png" alt="" />
        <a class="download" onclick="dl()"></a>
        <div class="loading" style="display: none;"></div>
        <div class="showtext" style="display: none;width: 100%;height: 45px;position: absolute;top:60%;text-align: center;color:#7f6eb1;">
            <div style="font-size: 14px">正在安装，请按 Home 键在桌面查看</div>
        </div>
    </div>
    <div id="bg"></div>
    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript" src="flexible.js"></script>
    <script type="text/javascript" src="sweetalert.min.js"></script>
    <script type="text/javascript">
        var appIosUrl = "https://itunes.apple.com/cn/app/%e5%be%ae%e6%b7%98%e6%b0%aa/id1331327046?mt=8";
        var appAndroidUrl = "http://dl.weitao.kr/weitao.apk";

        function check() {
            $(".loading").hide();
            $(".showtext").show();
        }
        $("#show").click(function () {
            $(this).hide();
            $("#bg").hide();
            $("#main_a").show();
        });

        function dl() {
            window.location.href = "https://a.app.qq.com/o/simple.jsp?pkgname=kr.weitao"
            // var ua = navigator.userAgent.toLowerCase();
            // if (ua.match(/MicroMessenger/i) == "micromessenger") {
            // window.location.href = appIosUrl
            // document.getElementById("bg").style.display = "block";
            // document.getElementById("show").style.display = "block";
            // document.getElementById("main_a").style.display = "none";
            // return;
            // }
            // var browser = {
            //     versions: function() {
            //         var u = navigator.userAgent,
            //             app = navigator.appVersion;
            //         return { //移动终端浏览器版本信息
            //             trident: u.indexOf('Trident') > -1, //IE内核
            //             presto: u.indexOf('Presto') > -1, //opera内核
            //             webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
            //             gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
            //             mobile: !!u.match(/AppleWebKit.*Mobile.*/) || !!u.match(/AppleWebKit/), //是否为移动终端
            //             ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
            //             android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或者uc浏览器
            //             iPhone: u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1, //是否为iPhone或者QQHD浏览器
            //             iPad: u.indexOf('iPad') > -1, //是否iPad
            //             webApp: u.indexOf('Safari') == -1 //是否web应该程序，没有头部与底部
            //         };
            //     }(),
            //     language: (navigator.browserLanguage || navigator.language).toLowerCase()
            // }

            // if (browser.versions.iPhone || browser.versions.ios) {
            // var ua = navigator.userAgent.toLowerCase();
            // alert(ua.match(/MicroMessenger/i) == "micromessenger")
            // if (ua.match(/MicroMessenger/i) == "micromessenger") {

            // } else {
            // $(".download").hide();
            // $(".loading").css("display", "inline-block");
            // setTimeout('check()', 5000);
            // window.location.href = appIosUrl
            // swal({
            //     title: "安装提示",
            //     text: '苹果用户您好，微淘氪正在App Store上架中，请耐心等待。'
            // });
            // }
            // } else if (browser.versions.android) {
            //     window.location.href = appAndroidUrl
            // } else {
            //     // alert("该设备不支持下载！");
            //     swal("安装提示", '该设备不支持下载！');
            // }
        }
        window.onload = function () {
            document.querySelector('.main').style.opacity = 1;
            var style =
                'transform: translateY(0);-webkit-transform: translateY(0);-moz-transform: translateY(0);-ms-transform: translateY(0);';
            document.querySelector('.download').setAttribute('style', style);
            document.querySelector('.download').style.opacity = 1;
        }
    </script>
</body>

</html>